import request from '@/utils/request';

//获取行政区划下拉
export function getRegionSelect () {
  return request({
    url: "/base/region/getRegionList",
    method: "get",
    params: {
      currentNode: 0, // 2表示行政区划
    },
  });
}

// 获取断面与入河排污口列表
export function getDmRiverList (data) {
  return request({
    url: "/base/segmentorrhoutfall/list",
    method: "get",
    params: data,
  });
}


// 获取断面列表
export function getDmList (data) {
  return request({
    url: "/base/segment/list",
    method: "get",
    params: data,
  });
}

// 获取断面详情
export function getDmRowDetail (id) {
  return request({
    url: `/base/segment/getinfo/${id}`,
    method: "get",
    // params: data,
  });
}

//删除断面
export function deleteDm (id) {
  return request({
    url: `/base/segment/remove/${id}`,
    method: "get",
  });
}
// 新增断面
export const segmentAdd = (data) =>
  request({
    url: "/base/segment/add",
    method: "post",
    data: data,
  })
// 编辑断面
export const segmentEdit = (data) =>
  request({
    url: "/base/segment/edit",
    method: "post",
    data: data,
  })

// 入河排污口下拉列表
export function getRoutfallSelect (data) {
  return request({
    url: "/pwk/rhoutfall/listall",
    method: "get",
    params: data,
  });
}

// 断面与入河排污口列表获取
export function getDmRoutfallList (data) {
  return request({
    url: "/base/segmentorrhoutfall/list",
    method: "get",
    params: data,
  });
}
// 断面与入河排污口详情
export function getDmRoutfallDetail (id) {
  return request({
    url: `/base/segmentorrhoutfall/${id}`,
    method: "get",
  });
}

// 断面与入河排污口修改
export function updateDmRoutfall (data) {
  return request({
    url: "/base/segmentorrhoutfall",
    method: "put",
    data,
  });
}
// 断面与入河排污口新增
export function addDmRoutfall (data) {
  return request({
    url: "/base/segmentorrhoutfall",
    method: "post",
    data,
  });
}
// 断面与入河排污口删除
export function deleteDmRoutfall (id) {
  return request({
    url: `/base/segmentorrhoutfall/${id}`,
    method: "delete",
  });
}

// 所属河流下拉
export function getRiverSelect (basinid) {
  return request({
    url: "/base/river/listall",
    method: "get",
    params: { basinid },
  });
}

// 所属流域下拉
export function getBasinSelect () {
  return request({
    url: "/base/basin/list",
    method: "get",
  });
}
// 获取水文站列表
export function getHydrologyList (data) {
  return request({
    url: "/base/hydrology/list",
    method: "get",
    params: data,
  });
}

// 水文站详情
export function getHydrologyDetail (id) {
  return request({
    url: `/base/hydrology/${id}`,
    method: "get",
  });
}

// 水文站修改
export function updateHydrology (data) {
  return request({
    url: "/base/hydrology",
    method: "put",
    data,
  });
}

// 水文站新增
export function addHydrology (data) {
  return request({
    url: "/base/hydrology",
    method: "post",
    data,
  });
}

// 水文站删除
export function deleteHydrology (id) {
  return request({
    url: `/base/hydrology/${id}`,
    method: "delete",
  });
}


//获取雨量站列表
export function getRainfallList (data) {
  return request({
    url: "/base/rainfallstation/list",
    method: "get",
    params: data,
  });
}

// 雨量站详情
export function getRainfallDetail (id) {
  return request({
    url: `/base/rainfallstation/${id}`,
    method: "get",
  });
}
// 雨量站修改
export function updateRainfall (data) {
  return request({
    url: "/base/rainfallstation",
    method: "put",
    data,
  });
}
// 雨量站新增
export function addRainfall (data) {
  return request({
    url: "/base/rainfallstation",
    method: "post",
    data,
  });
}
// 雨量站删除
export function deleteRainfall (id) {
  return request({
    url: `/base/rainfallstation/${id}`,
    method: "delete",
  });
}

// 水源地下拉接口
export function getdrinksourcelist (query) {
  return request({
    url: '/drink/drinksource/list',
    method: 'get',
    params: query
  })
}


// 水质质控列表接口
export function getWaterQualityControlList (query) {
  return request({
    url: '/data/meteorological/getQualityControlData',
    method: 'get',
    params: query
  })
}
